﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WooCoo.DataPortal
{
    public static class XmlConstants
    {
        #region CLR / Reflection constants.

        /// <summary>"InitializeService" method name for service initialize.</summary>
        public const string ClrServiceInitializationMethodName = "InitializeService";

        #endregion CLR / Reflection constants.

        #region HTTP constants.

        /// <summary>id of the corresponding body</summary>
        public const string HttpContentID = "Content-ID";

        /// <summary>byte-length of the corresponding body</summary>
        public const string HttpContentLength = "Content-Length";

        /// <summary>mime-type of the corresponding body</summary>
        public const string HttpContentType = "Content-Type";

        /// <summary>content disposition of the response (a hint how to handle the response)</summary>
        public const string HttpContentDisposition = "Content-Disposition";

        /// <summary>'OData-Version' - HTTP header name for OData version.</summary>
        public const string HttpODataVersion = "OData-Version";

        /// <summary>'OData-MaxVersion' - HTTP header name for maximum understood OData version.</summary>
        public const string HttpODataMaxVersion = "OData-MaxVersion";

        /// <summary>
        /// 'Prefer' - HTTP request header name for client preferences. 
        /// Refer to: http://tools.ietf.org/id/draft-snell-http-prefer-02.txt for details.
        /// </summary>
        public const string HttpPrefer = "Prefer";
        /// <summary>
        /// 'Preference-Applied' - HTTP response header name for client preference response.
        /// </summary>
        public const string HttpPreferenceApplied = "Preference-Applied";
        /// <summary>'no-cache' - HTTP value for Cache-Control header.</summary>
        public const string HttpCacheControlNoCache = "no-cache";

        /// <summary>'charset' - HTTP parameter name.</summary>
        public const string HttpCharsetParameter = "charset";

        /// <summary>HTTP method name for GET requests.</summary>
        public const string HttpMethodGet = "GET";

        /// <summary>HTTP method name for POST requests.</summary>
        public const string HttpMethodPost = "POST";

        /// <summary> Http Put Method name - basically used for updating resource.</summary>
        public const string HttpMethodPut = "PUT";

        /// <summary>HTTP method name for delete requests.</summary>
        public const string HttpMethodDelete = "DELETE";

        /// <summary>HTTP method name for PATCH requests.</summary>
        public const string HttpMethodPatch = "PATCH";

        /// <summary>HTTP query string parameter value for expand.</summary>
        public const string HttpQueryStringExpand = "$expand";

        /// <summary>HTTP query string parameter value for filtering.</summary>
        public const string HttpQueryStringFilter = "$filter";

        /// <summary>HTTP query string parameter value for ordering.</summary>
        public const string HttpQueryStringOrderBy = "$orderby";

        /// <summary>HTTP query string parameter value for skipping elements.</summary>
        public const string HttpQueryStringSkip = "$skip";

        /// <summary>HTTP query string parameter value for limiting the number of elements.</summary>
        public const string HttpQueryStringTop = "$top";

        /// <summary>HTTP query string parameter value for counting query result set, $count=true</summary>
        public const string HttpQueryStringQueryCount = "$count";

        /// <summary>HTTP query string parameter value for skipping results based on paging.</summary>
        public const string HttpQueryStringSkipToken = "$skiptoken";

        /// <summary>Property prefix for the skip token property in expanded results for a skip token</summary>
        public const string SkipTokenPropertyPrefix = "SkipTokenProperty";

        /// <summary>HTTP query string parameter value for counting query result set</summary>
        public const string HttpQueryStringSegmentCount = "$count";

        /// <summary>HTTP query string parameter value for projection.</summary>
        public const string HttpQueryStringSelect = "$select";

        /// <summary>HTTP query string parameter for specifying the requested content-type of the response.</summary>
        public const string HttpQueryStringFormat = "$format";

        /// <summary>HTTP query string parameter for specifying the a callback function name for JSONP (JSON padding).</summary>
        public const string HttpQueryStringCallback = "$callback";

        /// <summary>HTTP query string parameter for specifying the a entity id.</summary>
        public const string HttpQueryStringId = "$id";

        /// <summary>'q' - HTTP q-value parameter name.</summary>
        public const string HttpQValueParameter = "q";

        /// <summary>'X-HTTP-Method' - HTTP header name for requests that want to tunnel a method through POST.</summary>
        public const string HttpXMethod = "X-HTTP-Method";

        /// <summary>HTTP name for Accept header</summary>
        public const string HttpRequestAccept = "Accept";

        /// <summary>HTTP name for Accept-Charset header</summary>
        public const string HttpRequestAcceptCharset = "Accept-Charset";

        /// <summary>HTTP name for If-Match header</summary>
        public const string HttpRequestIfMatch = "If-Match";

        /// <summary>HTTP name for If-None-Match header</summary>
        public const string HttpRequestIfNoneMatch = "If-None-Match";

        /// <summary>HTTP name for User-Agent header</summary>
        public const string HttpUserAgent = "User-Agent";

        /// <summary>multi-part keyword in content-type to identify batch separator</summary>
        public const string HttpMultipartBoundary = "boundary";

        /// <summary>'X-Content-Type-Options' - HTTP header for Internet Explorer 8 and 9 to specify options for content-type handling.</summary>
        public const string XContentTypeOptions = "X-Content-Type-Options";

        /// <summary>An 'X-Content-Type-Options' HTTP header argument to instruct IE8/9 not to sniff the content and instead display it according to the content-type header.</summary>
        public const string XContentTypeOptionNoSniff = "nosniff";

        /// <summary>'Allow' - HTTP response header for allowed verbs.</summary>
        public const string HttpResponseAllow = "Allow";

        /// <summary>HTTP name for Cache-Control header.</summary>
        public const string HttpResponseCacheControl = "Cache-Control";

        /// <summary>HTTP name for ETag header</summary>
        public const string HttpResponseETag = "ETag";

        /// <summary>HTTP name for location header</summary>
        public const string HttpResponseLocation = "Location";

        /// <summary>HTTP name for OData-EntityId header</summary>
        public const string HttpODataEntityId = "OData-EntityId";

        /// <summary>HTTP name for Status-Code header</summary>
        public const string HttpResponseStatusCode = "Status-Code";

        /// <summary>multi-part mixed batch separator for response stream</summary>
        public const string HttpMultipartBoundaryBatchResponse = "batchresponse";

        /// <summary>multi-part mixed changeset separator</summary>
        public const string HttpMultipartBoundaryChangesetResponse = "changesetresponse";

        /// <summary>Content-Transfer-Encoding header for batch requests.</summary>
        public const string HttpContentTransferEncoding = "Content-Transfer-Encoding";

        /// <summary>Http Version in batching requests and response.</summary>
        public const string HttpVersionInBatching = "HTTP/1.1";

        /// <summary>To checks if the resource exists or not.</summary>
        public const string HttpAnyETag = "*";

        /// <summary>Weak etags in HTTP must start with W/.
        /// Look in http://www.ietf.org/rfc/rfc2616.txt?number=2616 section 14.19 for more information.</summary>
        public const string HttpWeakETagPrefix = "W/\"";

        /// <summary>The mime type that client wants the response to be in.</summary>
        public const string HttpAccept = "Accept";

        /// <summary>The character set the client wants the response to be in.</summary>
        public const string HttpAcceptCharset = "Accept-Charset";

        /// <summary>The name of the Cookie HTTP header</summary>
        public const string HttpCookie = "Cookie";

        /// <summary>The Slug header name. Used by ATOM to hint the server on which MR is being POSTed.</summary>
        public const string HttpSlug = "Slug";

        #endregion HTTP constants.

        #region MIME constants.

        /// <summary>MIME type for requesting any media type.</summary>
        public const string MimeAny = "*/*";

        /// <summary>MIME type general binary bodies (http://www.iana.org/assignments/media-types/application/).</summary>
        public const string MimeApplicationOctetStream = "application/octet-stream";
#if !ASTORIA_CLIENT
        /// <summary>MIME type for ATOM bodies (http://www.iana.org/assignments/media-types/application/).</summary>
        public const string MimeApplicationAtom = "application/atom+xml";

        /// <summary>MIME type for JSON bodies in light mode with minimal metadata.</summary>
        public const string MimeApplicationJsonODataMinimalMetadata = "application/json;odata.metadata=minimal";

        /// <summary>MIME type for JSON bodies in light mode with full metadata.</summary>
        public const string MimeApplicationJsonODataFullMetadata = "application/json;odata.metadata=full";

        /// <summary>MIME type for JSON bodies in light mode with no metadata.</summary>
        public const string MimeApplicationJsonODataNoMetadata = "application/json;odata.metadata=none";

        /// <summary>MIME type for JSON bodies (implies light in V3, verbose otherwise) (http://www.iana.org/assignments/media-types/application/).</summary>
        public const string MimeApplicationJson = "application/json";

        /// <summary>MIME type for batch requests - this mime type must be specified in CUD changesets or GET batch requests.</summary>
        public const string MimeApplicationHttp = "application/http";

        /// <summary>MIME type for XML bodies.</summary>
        public const string MimeApplicationXml = "application/xml";

        /// <summary>"application/xml", MIME type for metadata requests.</summary>
        public const string MimeMetadata = MimeApplicationXml;
#endif
        /// <summary>'application' - MIME type for application types.</summary>
        public const string MimeApplicationType = "application";

        /// <summary>'json' - constant for MIME JSON subtypes.</summary>
        public const string MimeJsonSubType = "json";

        /// <summary>'xml' - constant for MIME xml subtypes.</summary>
        public const string MimeXmlSubType = "xml";

        /// <summary>'odata' - parameter name for JSON MIME types.</summary>
        public const string MimeODataParameterName = "odata.metadata";

        /// <summary>MIME type for changeset multipart/mixed</summary>
        public const string MimeMultiPartMixed = "multipart/mixed";

        /// <summary>MIME type for plain text bodies.</summary>
        public const string MimeTextPlain = "text/plain";

        /// <summary>'text' - MIME type for text subtypes.</summary>
        public const string MimeTextType = "text";

        /// <summary>MIME type for XML bodies (deprecated).</summary>
        public const string MimeTextXml = "text/xml";

        /// <summary>Content-Transfer-Encoding value for batch requests.</summary>
        public const string BatchRequestContentTransferEncoding = "binary";

#if !ASTORIA_CLIENT || ASTORIA_LIGHT || PORTABLELIB
        /// <summary>text for the utf8 encoding</summary>
        public const string Utf8Encoding = "UTF-8";
#endif
#if ASTORIA_CLIENT
        /// <summary>Default encoding used for writing textual media link entries</summary>
        public const string MimeTypeUtf8Encoding = ";charset=UTF-8";
#endif
        #endregion MIME constants.

        #region URI constants.

        /// <summary>A prefix that turns an absolute-path URI into an absolute-URI.</summary>
        public const string UriHttpAbsolutePrefix = "http://host";

        /// <summary>A segment name in a URI that indicates metadata is being requested.</summary>
        public const string UriMetadataSegment = "$metadata";

        /// <summary>A segment name in a URI that indicates a plain primitive value is being requested.</summary>
        public const string UriValueSegment = "$value";

        /// <summary>A segment name in a URI that indicates metadata is being requested.</summary>
        public const string UriBatchSegment = "$batch";

        /// <summary>A segment name in a URI that indicates that this is a link operation.</summary>
        public const string UriLinkSegment = "$ref";

        /// <summary>A segment name in a URI that indicates that this is a count operation.</summary>
        public const string UriCountSegment = "$count";

        /// <summary>A const value for query parameter $count to set counting mode to true </summary>
        public const string UriCountTrueOption = "true";

        /// <summary>A const value for query parameter $count to set counting mode to false </summary>
        public const string UriCountFalseOption = "false";

        /// <summary>Uri method name for Enumerable.Any().</summary>
        public const string AnyMethodName = "any";

        /// <summary>Uri method name for Enumerable.All().</summary>
        public const string AllMethodName = "all";

        /// <summary>Implicit parameter "it" used for Queryable.Where lambda.</summary>
        public const string ImplicitFilterParameter = "$it";
        
        #endregion URI constants.

        #region JSON Format constants

        /// <summary>JSON property name for an error.</summary>
        public const string JsonError = "error";

        /// <summary>JSON property name for an error code.</summary>
        public const string JsonErrorCode = "code";

        /// <summary>JSON property name for the inner error details.</summary>
        public const string JsonErrorInner = "innererror";

        /// <summary>JSON property name for an public exception.</summary>
        public const string JsonErrorpublicException = "publicexception";

        /// <summary>JSON property name for an error message.</summary>
        public const string JsonErrorMessage = "message";

        /// <summary>JSON property name for an exception stack trace.</summary>
        public const string JsonErrorStackTrace = "stacktrace";

        /// <summary>JSON property name for an exception type.</summary>
        public const string JsonErrorType = "type";

        /// <summary>JSON property name for an error message value.</summary>
        public const string JsonErrorValue = "value";
        #endregion //JSON Format constants
  
        #region Astoria Constants

        /// <summary>'4.0' - the version 4.0 text for a data service.</summary>
        public const string ODataVersion4Dot0 = "4.0";

        /// <summary>'binary' constant prefixed to binary literals.</summary>
        public const string LiteralPrefixBinary = "binary";

        /// <summary>'geography' constant prefixed to geography literals.</summary>
        public const string LiteralPrefixGeography = "geography";

        /// <summary>'geometry' constant prefixed to geometry literals.</summary>
        public const string LiteralPrefixGeometry = "geometry";

        /// <summary>'duration' constant prefixed to duration literals.</summary>
        public const string LiteralPrefixDuration = "duration";

        /// <summary>'M': Suffix for decimal type's string representation</summary>
        public const string LiteralSuffixDecimal = "M";

        /// <summary>'L': Suffix for long (int64) type's string representation</summary>
        public const string LiteralSuffixInt64 = "L";

        /// <summary>'f': Suffix for float (single) type's string representation</summary>
        public const string LiteralSuffixSingle = "f";

        /// <summary>'D': Suffix for double (Real) type's string representation</summary>
        public const string LiteralSuffixDouble = "D";

        /// <summary>null liternal that needs to be return in ETag value when the value is null</summary>
        public const string NullLiteralInETag = "null";

        /// <summary>Incoming message property name for the original reqeust uri</summary>
        public const string MicrosoftDataServicesRequestUri = "MicrosoftDataServicesRequestUri";

        /// <summary>Incoming message property name for the original root service uri</summary>
        public const string MicrosoftDataServicesRootUri = "MicrosoftDataServicesRootUri";

        #endregion // Astoria Constants
        
    }
}
